﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.Sql;
using GMS.MainForm;

namespace GMS.MainClasses
{
    public partial class ChildForms : Form
    {
        private String connectionString;
        public MainRunnableForm MRF;
        public String ConnectionString
        {
            get { return connectionString; }
            set { connectionString = value; }
        }
        private String[] storedProcedures;
        public String[] StoredProcedures
        {
            get { return storedProcedures; }
            set { storedProcedures = value; }
        }
        public ChildForms()
        {
            InitializeComponent();
        }
        public void ShowHideOptionPanel()
        {
            if (splitContainer1.Panel1Collapsed == true)
                splitContainer1.Panel1Collapsed = false;
            else
                splitContainer1.Panel1Collapsed = true;
        }

        protected virtual void ChildForms_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (DialogResult == DialogResult.OK)
            {
                e.Cancel = false;
            }
            else
            {
                if (MessageBox.Show("Закрываем - " + this.Text.Trim() + " ?", "Иформация", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    e.Cancel = false;
                }
                else
                    e.Cancel = true;
            }
        }
        protected virtual void ChildForms_Load(object sender, EventArgs e)
        {
            MRF = (MainRunnableForm)this.MdiParent;
        }
    }
}
